package br.com.news.service;

import java.util.List;

import javax.inject.Inject;
import javax.inject.Named;

import br.com.news.utils.business.exception.BusinessException;
import br.com.news.utils.business.interfaces.IAlternativaEnqueteBusiness;
import br.com.news.utils.database.beans.AlternativaEnqueteBean;
import br.com.news.utils.service.exception.ServiceException;
import br.com.news.utils.service.interfaces.IAlternativaEnqueteService;

@Named
public class AlternativaEnqueteService implements IAlternativaEnqueteService{

	@Inject
	private IAlternativaEnqueteBusiness alternativaEnqueteBusiness;
	
	@Override
	public List<AlternativaEnqueteBean> findAll() throws ServiceException {
		try {
			return alternativaEnqueteBusiness.findAll();
		} catch (BusinessException e) {
			throw new ServiceException(e);
		}
	}

	@Override
	public void save(AlternativaEnqueteBean alternativaEnquete)
			throws ServiceException {
		try {
			alternativaEnqueteBusiness.save(alternativaEnquete);
		} catch (BusinessException e) {
			throw new ServiceException(e);
		}
	}

}
